<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
	<th:block th:include="include :: header('加载data数据')" />
</head>
<body class="gray-bg">
     <div class="container-div">
		<div class="row">
			<div class="col-sm-12 search-collapse">
				<form id="formId">
					<div class="select-list">
						<ul>
							<li>
								<label>物料名称：</label>
								<input type="text" name="key"/>
							</li>
							<li>
								<label>产线名称：</label>
								<select name="status" >
									<option value="">所有</option>
								</select>
							</li>
							<li>
								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
								<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
							</li>
						</ul>
					</div>
				</form>
			</div>
			<div class="col-sm-12 select-table table-striped">
				<table id="bootstrap-table"></table>
			</div>
		</div>
	</div>
    <div th:include="include :: footer"></div>
    <script th:inline="javascript">
        var datas = [[${@dict.getType('sys_normal_disable')}]];

        //设备
        var deviceData =[
        		{

				"id": 1,
				"deviceTitle": "1号车",
				"deviceType": "筒段AGV",
				"enableStatus": "可用",
				"online": "在线",
				"ip": "无",

				"protocolType": "激光",
				"onPoint": "17,23"
			}, {

				"id": 2,
				"deviceTitle": "2号车",
				"deviceType": "筒段AGV",
				"enableStatus": "可用",
				"online": "在线",
				"ip": "无",

				"protocolType": "激光",
				"onPoint": "17,23"
			}, {

				"id": 3,
				"deviceTitle": "3号车",
				"deviceType": "筒段AGV",
				"enableStatus": "可用",
				"online": "在线",
				"ip": "无",

				"protocolType": "激光",
				"onPoint": "17,23"
			}, {

				"id": 4,
				"deviceTitle": "4号车",
				"deviceType": "筒段AGV",
				"enableStatus": "可用",
				"online": "在线",
				"ip": "无",

				"protocolType": "激光",
				"onPoint": "17,23"
			}, {

				"id": 5,
				"deviceTitle": "5号车",
				"deviceType": "筒段AGV",
				"enableStatus": "可用",
				"online": "在线",
				"ip": "无",

				"protocolType": "激光",
				"onPoint": "17,23"
			}, {

				"id": 6,
				"deviceTitle": "6号车",
				"deviceType": "筒段AGV",
				"enableStatus": "可用",
				"online": "在线",
				"ip": "无",

				"protocolType": "激光",
				"onPoint": "17,23"
			}, {

				"id": 7,
				"deviceTitle": "7号车",
				"deviceType": "筒段AGV",
				"enableStatus": "可用",
				"online": "在线",
				"ip": "无",

				"protocolType": "激光",
				"onPoint": "17,23"
			}, {

				"id": 8,
				"deviceTitle": "8号车",
				"deviceType": "筒段AGV",
				"enableStatus": "可用",
				"online": "在线",
				"ip": "无",

				"protocolType": "激光",
				"onPoint": "17,23"
			}, {

				"id": 9,
				"deviceTitle": "1号机器人",
				"deviceType": "转载机器人",
				"enableStatus": "可用",
				"online": "在线",
				"ip": "无",
				"protocolType": "激光",
				"onPoint": "17,23"
			},{

				"id": 10,
				"deviceTitle": "9号车",
				"deviceType": "一子级RGV",
				"enableStatus": "可用",
				"online": "在线",
				"ip": "无",
				"protocolType": "激光",
				"onPoint": "17,23"
			},{

				"id": 11,
				"deviceTitle": "10号车",
				"deviceType": "一子级RGV",
				"enableStatus": "可用",
				"online": "在线",
				"ip": "无",
				"protocolType": "激光",
				"onPoint": "17,23"
			},{

				"id": 12,
				"deviceTitle": "11号车",
				"deviceType": "二子级RGV",
				"enableStatus": "可用",
				"online": "在线",
				"ip": "无",
				"protocolType": "激光",
				"onPoint": "17,23"
			},{

				"id": 13,
				"deviceTitle": "12号车",
				"deviceType": "二子级RGV",
				"enableStatus": "可用",
				"online": "在线",
				"ip": "无",
				"protocolType": "激光",
				"onPoint": "17,23"
			},{

				"id": 14,
				"deviceTitle": "13号车",
				"deviceType": "三子级RGV",
				"enableStatus": "可用",
				"online": "在线",
				"ip": "无",
				"protocolType": "激光",
				"onPoint": "17,23"
			},{

				"id": 15,
				"deviceTitle": "14号车",
				"deviceType": "三子级RGV",
				"enableStatus": "可用",
				"online": "在线",
				"ip": "无",
				"protocolType": "激光",
				"onPoint": "17,23"
			}
		]
		var deviceColumns = [
			{
				checkbox: true
			},
			{
				field : 'id',
				title : '设备编号'
			},
			{
				field : 'deviceTitle',
				title : '设备名称'
			},
			{
				field : 'deviceType',
				title : '设备类型'
			},
			{
				field : 'enableStatus',
				title : '启用状态'
			},
			{
				field : 'online',
				title : '设备在线状态'
			},
			{
				field : 'ip',
				title : 'IP端口'
			},
			{
				field: 'protocolType',
				title: '协议类型',
			},
			{
				field: 'onPoint',
				title: '待命点',
			},
			{
				title: '操作',
				align: 'center',
				formatter: function(value, row, index) {
					var actions = [];
					actions.push('<a class="btn btn-success btn-xs" href="#"><i class="fa fa-edit"></i>编辑</a> ');
					actions.push('<a class="btn btn-danger btn-xs" href="#"><i class="fa fa-remove"></i>删除</a>');
					return actions.join('');
				}
			}
		]

		//运行任务
		var runTaskData =  [
			{
				"id": 1,
				"deviceTitle": "1",
				"deviceType": "人工向TIS下发一、二、三子级RGV运动到转载区对应的",
				"enableStatus": "产线一",
				"online": "2022/1/21 10:40",
				"ip": "2022/1/21 10:40",
				"protocolType": "自动",
				"onPoint": "执行中"
			},{

				"id": 1,
				"deviceTitle": "1",
				"deviceType": "公路运输车运输筒段6",
				"enableStatus": "产线一",
				"online": "2022/1/21 10:40",
				"ip": "",
				"protocolType": "人工",
				"onPoint": "未开始"
			},{

				"id": 1,
				"deviceTitle": "1",
				"deviceType": "吊装筒段6至3子级RGV",
				"enableStatus": "产线一",
				"online": "2022/1/21 10:40",
				"ip": "",
				"protocolType": "人工",
				"onPoint": "未开始"
			},{

				"id": 1,
				"deviceTitle": "1",
				"deviceType": "TIS下发三子级RGV开至装配区固定位置",
				"enableStatus": "产线一",
				"online": "2022/1/21 10:40",
				"ip": "",
				"protocolType": "自动",
				"onPoint": "未开始"
			},{

				"id": 1,
				"deviceTitle": "1",
				"deviceType": "TIS下发三子级RGV调姿软件找正",
				"enableStatus": "产线一",
				"online": "2022/1/21 10:40",
				"ip": "",
				"protocolType": "自动",
				"onPoint": "未开始"
			},{

				"id": 1,
				"deviceTitle": "1",
				"deviceType": "TIS下发三子级RGV调姿软件找正",
				"enableStatus": "产线一",
				"online": "2022/1/21 10:40",
				"ip": "",
				"protocolType": "人工",
				"onPoint": "未开始"
			},{

				"id": 1,
				"deviceTitle": "1",
				"deviceType": "三子级RGV调姿软件向三子级RGV视觉软件发送标定指令",
				"enableStatus": "产线一",
				"online": "2022/1/21 10:40",
				"ip": "",
				"protocolType": "自动",
				"onPoint": "未开始"
			},
		]
		var runTaskColumns = [
			{
				checkbox: true
			},
			{
				field : 'id',
				title : '总装任务编号',
				formatter: function(value, row, index) {
					return index+1;
				}
			},
			{
				field : 'deviceTitle',
				title : '任务编号'
			},
			{
				field : 'deviceType',
				title : '任务名称'
			},
			{
				field : 'enableStatus',
				title : '产线'
			},
			{
				field : 'online',
				title : '任务开始时间'
			},
			{
				field : 'ip',
				title : '任务结束时间'
			},
			{
				field: 'protocolType',
				title: '任务类型',
			},
			{
				field: 'onPoint',
				title: '任务状态',
			},
			{
				title: '操作',
				align: 'center',
				formatter: function(value, row, index) {
					var actions = [];
					actions.push('<a class="btn btn-success btn-xs" href="#"><i class="fa fa-edit"></i>编辑</a> ');
					actions.push('<a class="btn btn-danger btn-xs" href="#"><i class="fa fa-remove"></i>删除</a>');
					return actions.join('');
				}
			}
		]

		//物料
		var materialData=[
			{

				"id": 1,
				"deviceTitle": "筒段6",
				"deviceType": "产线一",
				"enableStatus": "进线",
				"online": "3子级RGV",
				"ip": "转载区",
				"protocolType": "1",
			},{

				"id": 1,
				"deviceTitle": "筒段5",
				"deviceType": "产线一",
				"enableStatus": "进线",
				"online": "3子级RGV",
				"ip": "转载区",
				"protocolType": "1",
			},
			{

				"id": 1,
				"deviceTitle": "筒段2",
				"deviceType": "产线一",
				"enableStatus": "进线",
				"online": "3子级RGV",
				"ip": "转载区",
				"protocolType": "1",
			},
			{

				"id": 1,
				"deviceTitle": "筒段7",
				"deviceType": "产线一",
				"enableStatus": "进线",
				"online": "3子级RGV",
				"ip": "转载区",
				"protocolType": "1",
			},
			{

				"id": 1,
				"deviceTitle": "封头",
				"deviceType": "产线一",
				"enableStatus": "缺料",
				"online": "",
				"ip": "",
				"protocolType": "1",
			},
			{

				"id": 1,
				"deviceTitle": "缺料",
				"deviceType": "产线一",
				"enableStatus": "缺料",
				"online": "",
				"ip": "",
				"protocolType": "1",
			}
		]

		var materialColumns = [
			{
				checkbox: true
			},
			{
				field : 'id',
				title : '物料编号',
				formatter: function(value, row, index) {
					return index+1;
				}
			},
			{
				field : 'deviceTitle',
				title : '物料名称'
			},
			{
				field : 'deviceType',
				title : '产线'
			},
			{
				field : 'enableStatus',
				title : '物料状态'
			},
			{
				field : 'online',
				title : '物料位置'
			},
			{
				field : 'ip',
				title : '区域'
			},
			{
				field: 'protocolType',
				title: '数量',
			},
			{
				title: '操作',
				align: 'center',
				formatter: function(value, row, index) {
					var actions = [];
					actions.push('<a class="btn btn-success btn-xs" href="#"><i class="fa fa-edit"></i>编辑</a> ');
					actions.push('<a class="btn btn-danger btn-xs" href="#"><i class="fa fa-remove"></i>删除</a>');
					return actions.join('');
				}
			}
		]

        $(function() {
            var options = {
                data: materialData,
                sidePagination: "client",
		        showSearch: false,
		        showRefresh: false,
		        showToggle: false,
		        showColumns: false,
                columns: materialColumns,
            };
            $.table.init(options);
        });
    </script>
</body>
</html>